<%@page import="models.SolutionAdoption"%>
<%@ page import="com.googlecode.objectify.Objectify, com.googlecode.objectify.ObjectifyService, com.googlecode.objectify.Query" %>
<%@ page import = "controllers.SolutionConnect, controllers.AdoptionConnect" %>
<%@ page import = "models.SolutionSubmission, models.Location" %>
<%@ page import="java.util.*" %>


<graph xaxisname='Benefit' yaxisname='$ Saved' hovercapbg='DEDEBE' hovercapborder='889E6D' rotateNames='0' yAxisMaxValue='100' numdivlines='9' divLineColor='CCCCCC' divLineAlpha='80' decimalPrecision='1' showAlternateHGridColor='1' AlternateHGridAlpha='30' AlternateHGridColor='CCCCCC' caption='Annual Production Savings by category' subcaption='' >

<categories font='Arial' fontSize='11' fontColor='000000'>
      <category name='Hard Savings' hoverText='All Solutions' />
      <category name='Cost Avoidance' hoverText='All Solutions' />
	<category name='Opportunity Costs' hoverText='All Solutions' />
</categories>


<%

Objectify ofy = ObjectifyService.begin();
Query<SolutionSubmission> q = ofy.query(SolutionSubmission.class).filter("Status", "Shared");
float atotalHS = 0;
float atotalCA = 0;
float atotalOC = 0;
 
for ( SolutionSubmission f : q.fetch() ) {
	atotalHS = atotalHS + (Float) f.getHardSavings();
	atotalCA = atotalCA + (Float) f.getCostAvoidance();
	atotalOC = atotalOC + (Float) f.getOppurtunityCost();
}

Query<SolutionAdoption> qq = ofy.query(SolutionAdoption.class);
float btotalHS = 0;
float btotalCA = 0;
float btotalOC = 0;
 
for ( SolutionAdoption f : qq.fetch() ) {
	btotalHS = btotalHS + (Float) f.getHardSavings();
	btotalCA = btotalCA + (Float) f.getCostAvoidance();
	btotalOC = btotalOC + (Float) f.getOppurtunityCost();	
}

%>

  <dataset seriesname='Shared Solutions' color='FDC12E'>
      <set value='<%=atotalHS %>' />
      <set value='<%=atotalCA %>' />
 		<set value='<%=atotalOC %>' />
 
</dataset>

 <dataset seriesname='Adopted Solutions' color='0DE12E'>
      <set value='<%=btotalHS %>' />
      <set value='<%=btotalCA %>' />
 		<set value='<%=btotalOC %>' />
</dataset>



</graph>


<!-- 





<graph xaxisname='Benefit' yaxisname='$ Saved' hovercapbg='DEDEBE' hovercapborder='889E6D' rotateNames='0' yAxisMaxValue='100' numdivlines='9' divLineColor='CCCCCC' divLineAlpha='80' decimalPrecision='<Computed Value>' showAlternateHGridColor='1' AlternateHGridAlpha='30' AlternateHGridColor='CCCCCC' caption='Annual Production Savings by category' subcaption='' >

<categories font='Arial' fontSize='11' fontColor='000000'>
      <category name='Hard Savings' hoverText='All Solutions' />
      <category name='Cost Avoidance' hoverText='All Solutions' />
	<category name='Opportunity Costs' hoverText='All Solutions' />
 </categories>


  <dataset seriesname='Shared Solutions' color='FDC12E'>
      <set value='<Computed Value>' />
      <set value='<Computed Value>' />
 <set value='<Computed Value>' />
 
</dataset>

  <dataset seriesname='Adopted Solutions' color='0DE12E'>
      <set value='<Computed Value>' />
      <set value='<Computed Value>' />
<set value='<Computed Value>' />

</dataset>

</graph>


 -->